<?php


namespace app\plugin\controller\article\com;


use app\admin\controller\com\Admin;
use app\service\PluginsService;
use think\Controller;
use think\Request;

class ArticleManager extends Admin
{
    public $tag = 'article';
    public $param = null;


    public $plugin = null;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);

        $this->param = input();
        $info = PluginsService::get_plugin_info($this->tag);
        if ($info['code']==0){
            $this->plugin = $info['data'];
        }

        $this->assign('menu', $this->get_config('menu'));
    }

    private function get_config($key = '')
    {
        $config = require __DIR__ . '/config.php';
        if (!$key) {
            return $config;
        }
        return !empty($config[$key]) ? $config[$key] : [];

    }
}